package com.ruoyi.shop.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shop.mapper.ShopSupplierMapper;
import com.ruoyi.shop.domain.ShopSupplier;
import com.ruoyi.shop.service.IShopSupplierService;
import com.ruoyi.common.core.text.Convert;

/**
 * 供货商Service业务层处理
 * 
 * @author Alan Zhang
 * @date 2021-09-14
 */
@Service
public class ShopSupplierServiceImpl implements IShopSupplierService 
{
    @Autowired
    private ShopSupplierMapper shopSupplierMapper;

    /**
     * 查询供货商
     * 
     * @param id 供货商主键
     * @return 供货商
     */
    @Override
    public ShopSupplier selectShopSupplierById(Long id)
    {
        return shopSupplierMapper.selectShopSupplierById(id);
    }

    /**
     * 查询供货商列表
     * 
     * @param shopSupplier 供货商
     * @return 供货商
     */
    @Override
    public List<ShopSupplier> selectShopSupplierList(ShopSupplier shopSupplier)
    {
        return shopSupplierMapper.selectShopSupplierList(shopSupplier);
    }

    /**
     * 新增供货商
     * 
     * @param shopSupplier 供货商
     * @return 结果
     */
    @Override
    public int insertShopSupplier(ShopSupplier shopSupplier)
    {
        return shopSupplierMapper.insertShopSupplier(shopSupplier);
    }

    /**
     * 修改供货商
     * 
     * @param shopSupplier 供货商
     * @return 结果
     */
    @Override
    public int updateShopSupplier(ShopSupplier shopSupplier)
    {
        return shopSupplierMapper.updateShopSupplier(shopSupplier);
    }

    /**
     * 批量删除供货商
     * 
     * @param ids 需要删除的供货商主键
     * @return 结果
     */
    @Override
    public int deleteShopSupplierByIds(String ids)
    {
        return shopSupplierMapper.deleteShopSupplierByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除供货商信息
     * 
     * @param id 供货商主键
     * @return 结果
     */
    @Override
    public int deleteShopSupplierById(Long id)
    {
        return shopSupplierMapper.deleteShopSupplierById(id);
    }
}
